package com.gs.SynAntiWandering.model;

import com.gs.SynAntiWandering.callback.Callback;
import com.gs.SynAntiWandering.model.listener.OnResultListener;
import com.gs.SynAntiWandering.util.OKHttpUtil;

import java.lang.reflect.Type;

public class RecordsModel {
    public void getData(Object query, final OnResultListener listener, Type typeofT) {
        OKHttpUtil.getInstance().postAsync(OKHttpUtil.NET_URL + "/api/records",
                query, new Callback() {
                    @Override
                    public void onSuccess(Object obj) {
                        listener.onSuccess(obj);
                    }

                    @Override
                    public void onFailed(Exception e) {
                        listener.onFails(e);
                    }
                }, typeofT);
    }
}
